<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h4>ajax测试</h4>
请输入内容： <input type="number" id="demo" name="demo" oninput="update1()"/><br/>

当前价格： <div id="wrapper"></div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js">
</script>
<script>
      function update1() {
        var number = $('#demo').val();
        $.ajax({
            url: '/demo1',
            type: 'POST',
            data: {'number': number},
            success: function (response) {
                $('#wrapper').text(response.number);
                $('#wrapper').css('color', 'blue');
                {#location.href='/test'#}
            },
            error:function (){
                console.log('出错了！')
            }
        })
    }
</script>

</body>
</html>